const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
// const ExtractTextWebpackPlugin = require("extract-text-webpack-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
    entry: {
        index: "./src/index.js",
    },
    mode: "development",
    output: {
        filename: "[name].js",
        path: path.join(__dirname, "/release")
    },
    module:{
        rules: [
            {
                test: /\.css$/,
                use: [MiniCssExtractPlugin.loader, 'css-loader']
            },
            {
                test: /\.less$/,
                use: [MiniCssExtractPlugin.loader, 'css-loader', 'less-loader'],
            }
        ]
    },
    plugins :[
        new HtmlWebpackPlugin(
            {
                template: "./src/index.html"
            }
        ),
        new MiniCssExtractPlugin({
            filename: "[name].css"
        }),
    ]
}